package com.zy.controller;

import com.zy.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    private UserService userService;

    @RequestMapping(value = "/login")
    public String login(){
        return "登录成功";
    }

    @GetMapping(value = "/getUser")
    public String getUser(){
        return "获取所有用户信息";
    }


    @GetMapping(value = "/getUserById")
    public String getUserById(int UserId ){
        return "获取"+UserId+"用户信息";
    }

    @GetMapping(value = "/getUserByName")
    public String getUserByName(String UserName ){
        return "获取"+UserName+"用户信息";
    }

    @GetMapping(value = "/updateByName")
    public String updateByName(String UserName ){
        return "更新"+UserName+"用户信息";
    }

    @GetMapping(value = "/deleteByName")
    public String deleteByName(String UserName ){
        userService.deleteByName(UserName);
        return "删除"+UserName+"用户信息";
    }

}
